package simplefacory;

import entity.AmeiracaCoffee;
import entity.Coffee;
import entity.NaTieCoffee;

public class SimpleFactory {
    public Coffee order(String type){
        switch (type){
            case "1":
                return new AmeiracaCoffee();
            case "2":
                return new NaTieCoffee();
            default:
                throw new RuntimeException("没有此种咖啡");
        }
    }
}
